// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   OpenSongParser.java

package presenter;

import java.io.*;
import java.util.ArrayList;
import java.util.Scanner;
import javax.swing.JFileChooser;

public class OpenSongParser
{

    public OpenSongParser()
    {
        JFileChooser chooser = new JFileChooser();
        song = new ArrayList();
        int returnVal = chooser.showOpenDialog(null);
        if(returnVal == 0)
        {
            File f = chooser.getSelectedFile();
            readSong(f);
        }
    }

    public OpenSongParser(String f)
    {
    }

    public static void main(String args[])
    {
        new OpenSongParser();
    }

    private void readSong(File f)
    {
        boolean lyrics = false;
        try
        {
            BufferedReader br = new BufferedReader(new FileReader(f));
            do
            {
                String temp = br.readLine();
                if(temp == null)
                    break;
                if(lyrics)
                {
                    String newLine = "";
                    char line[] = temp.toCharArray();
                    if(!temp.equals(""))
                        if(line[0] == '.');
                } else
                {
                    Scanner s = new Scanner(temp);
                    s.useDelimiter("\\s*<");
                    String scan = s.next();
                    s = new Scanner(scan);
                    s.useDelimiter(">");
                    scan = s.next();
                    if(scan != null && scan.equals("lyrics"))
                        lyrics = true;
                }
            } while(true);
        }
        catch(Exception e)
        {
            e.printStackTrace();
        }
    }

    private ArrayList song;
}
